<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateGoodsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('goods', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name')->default('')->comment('商品名称');
            $table->integer('category_id')->default('0')->comment('商品分类');
            $table->string('image')->nullable()->comment('商品列表图');
            $table->json('images')->nullable()->comment('商品轮播图');
            $table->string('content')->nullable()->comment('商品详情');
            $table->decimal('price')->default('0.00')->comment('商品售价');
//            $table->float('city_rate0')->default(0.00)->comment("无区代理的市代理分成比例");
//            $table->float('city_rate1')->default(0.00)->comment("有区代理的市代理分成比例");
//            $table->float('district_rate')->default(0.00)->comment("区代理的分成比例");
//            $table->float('shop_rate')->default(0.00)->comment("门店分成比例");
//            $table->float('user_rate')->default(0.00)->comment("上级用户分销比例");
            $table->tinyInteger('status')->default('0')->comment('状态:0=上架,1=下架');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('goods');
    }
}
